class Hiscore extends Janela{

  Hiscore(){
    super();
    addLabel("hiscore", width/2 - 60, 20, "Hiscore Table");
    for (int i = 1; i <= 10; i++) addLabel(i + "", width/2 - 40, i*20 + 50, i + " ");
    addButton("ok", width/2 - 35, 320, 70, 20, "Voltar");
  }
  
  void init(){
    String[] aux;
    aux = db1.getHiscore(10);
    for (int i = 1; i <= 10; i++){
      aux[i-1] = aux[i-1] == null ? "-" : aux[i-1];
      setCaption(i+"", aux[i-1]);
    }
  }
  void update(){
    background(255);
    fill(0);
  }
  void objectClick(){
    String id = getObjectClickedId();
    if (id.equals("ok")){
      setActive(principal);
    }
  }
}
